

export function registerCard() {
  // 单据卡片
  joint.dia.Element.define(
    'standard.Rectangle',
    {
      attrs: {
        body: {
          rx: 4,
          ry: 4,
          width: 'calc(w)',
          height: 'calc(h)',
          strokeWidth: 1,
          stroke: '#5F6DEA',
          fill: 'rgba(95, 109, 234, 0.20)'
        },
        left: {
          x: '10',
        },
        font: {
          text: 'test',
          fontSize: 13,
          fill: 'rgba(70, 70, 75, 1)'
        },
        label: {
          textVerticalAnchor: 'bottom',
          textAnchor: 'right',
          x: '0',
          y: 'calc(0.5*h)',
          fontSize: 14,
          fill: '#333333'
        },
        card_type: {
          textVerticalAnchor: 'bottom',
          textAnchor: 'end',
          x: 'calc(1*w)',
          y: 'calc(0.5*h)',
          fontSize: 14,
          fill: 'red'
        },
        up_g: {
          width: '40',
          height: '20',
          strokeWidth: 2,
          stroke: '#000000',
          fill: '#FFFFFF'
        },
        up: {
          width: '40',
          height: '20',
          x: '0',
          y: 'calc(0.5*h)',
          strokeWidth: 2,
          stroke: '#000000',
          fill: '#FFFFFF'
        },
        up_label: {
          textVerticalAnchor: 'middle',
          textAnchor: 'right',
          refX: '0',
          refY: '100%',
          refX2: '10',
          refY2: '-14',
          fontSize: 14,
          fill: '#333333',
          text: 'up',
        },
        down: {
          width: '40',
          height: '20',
          x: 'calc(1*w - 40)',
          y: 'calc(0.5*h)',
          strokeWidth: 2,
          stroke: '#000000',
          fill: '#FFFFFF'
        },
        down_label: {
          textVerticalAnchor: 'bottom',
          textAnchor: 'right',
          refX: '100%',
          refY: '100%',
          refX2: '-40',
          refY2: '-5',
          fontSize: 14,
          fill: '#333333',
          text: 'down',
        },
      }
    },
    {
      markup: [
        {
          tagName: 'rect',
          selector: 'body',
        },
        {
          tagName: 'g',
          children: [
            {
              tagName: 'text',
              selector: 'objectType',
              groupSelector: ['group_left', 'font', 'left'],
            },
            {
              tagName: 'text',
              selector: 'code',
              groupSelector: ['group_left', 'font', 'left'],
            },
            {
              tagName: 'text',
              selector: 'businessDate',
              groupSelector: ['group_left', 'font', 'left'],
            },            {
              tagName: 'text',
              selector: 'createdUser',
              groupSelector: ['group_left', 'font', 'left'],
            },
          ]
        },
        {
          tagName: 'g',
          selector: 'up_g',
          children: [
            {
              tagName: 'rect',
              selector: 'up',
            },
            {
              tagName: 'text',
              selector: 'up_label'
            },
          ]
        },

        {
          tagName: 'rect',
          selector: 'down',
          children: []
        },
        {
          tagName: 'text',
          selector: 'down_label'
        },
        {
          tagName: 'text',
          selector: 'label'
        },
        {
          tagName: 'text',
          selector: 'card_type',
        },
      ]
    }
  );
}